<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Front extends CI_Controller {
    
    function __construct() {
        parent::__construct();
        $this->lang->load('ini_'.$this->config->item('language'), $this->config->item('language'));
    }

    public function index() {
        $this->load->model('producto_model');
        $this->load->model('promocion_model');
        $this->load->library('Controlador');
        $this->load->model('blog_model');
        $data['title'] = TITLES . lang('inicio');
        $data['datos_tags'] = $this->producto_model->getUltimasProvinciasConReserva();
        $data['posts'] = $this->blog_model->get_posts(5, 0);
        $data['comments'] = $this->blog_model->get_lasts_comment(5, 0);
        $data['productos'] = $this->producto_model->buscar_portada(5);
        $data['datos_slider'] = $this->promocion_model->getPromociones(null, null, 5, 1);
        $data['ruta_template'] = RUTA_TEMPLATE;
        $data['ruta'] = site_url().RUTA_TEMPLATE;
        $data['lugares'] = form_dropdown('p_lugares', $this->lugares(), '', 'id="p_lugares" style="display:none;" multiple="multiple"');
        
        $this->load->library('Twitter');
        $data['twitter'] = $this->twitter->getReplies(1);
        $data['contenido'] = $this->load->view('inicio', $data, true);
        
        $this->session->unset_userdata('p_churro');
        $this->load->view('index', $data);
    }
    
    function lugares(){
        $this->load->model('inicio_model');
        return $this->inicio_model->getLugares();
    }
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */